A publish/subscribe system (or “publish-subscribe” system) is an effective way of disseminating information from “publishers” to multiple users or “subscribers.” A publisher generates messages, also referred to as events, which contain a topic and some data content. A subscriber, also referred to as a “client,” provides, ahead of time, a criterion, also referred to as a subscription, that specifies the information, based on published messages, that the system (“messaging system”) is required to deliver to that subscriber client in the future. In a publish/subscribe system, publishers and subscribers are anonymous in that publishers do not necessarily know the number of subscribers or their locations; and subscribers do not necessarily know the locations of the publishers.
In the publish/subscribe system, subscribers typically receive only a subset of the total messages published. The messages may be selected for reception and processing using topic-based filtering. In a topic-based system, messages are published to “topics” or named logical channels. A topic may consist of multiple strings and wildcards. The publisher registers with a messaging application of the messaging system and defines the topics for the messages that will be published. For example, a publisher may publish messages pertaining to the soccer team of Manchester United (e.g., topic of “Sport/Soccer/ManchesterUnited”). A subscriber lists the topics of the messages (e.g., topic of “Sport/Soccer”) the subscriber desires to receive (“subscription criterion”). The messages may be filtered by the messaging application using the subscription criterion which can be tested on each published message independent of any other message. For example, a filtered published message might be “topic=Sport/Soccer” for all messages related to the topic of soccer. As a result, the subscriber would receive messages published by the publisher pertaining to the soccer team of Manchester United.
Unfortunately, in the existing messaging systems, such topics are created statically. The topics are predefined and the messages are routed based on these predefined topics. As a result, important messages may not be effectively disseminated between the publishers and subscribers. For example, currently, there has been an increase in data being generated by sensors, mobile devices, etc. For instance, suppose a car accident was detected. The message pertaining to the car accident may be published to all the cars within a one mile radius of the car involved in the accident. However, since cars are moving and their geolocation coordinates are constantly changing, a static subscription and static publication system would not be able to inform those new drivers that are now within the one mile radius of the car accident after the initial publication of the message.